<?php
/**
 * 病例
 */
class Diagnosis{
  /**
   * @var string Identity
   */
  public $Id;
      
  /**
   * @var string Unique医生编号
   */
  public $DoctorId;
      
  /**
   * @var string Unique病人编号
   */
  public $PatientId;
      
  /**
   * @var string 来诊原因
   */
  public $Reseaon;
      
  /**
   * @var string 问诊
   */
  public $Property_Ask;
      
  /**
   * @var string 望诊
   */
  public $Property_Look;
      
  /**
   * @var string 听诊
   */
  public $Property_Listen;
      
  /**
   * @var string 脉诊
   */
  public $Property_Touch;
      
  /**
   * @var string 诊断
   */
  public $Property_Result;
      
  /**
   * @var string 推拿，按摩
   */
  public $Massage;
      
  /**
   * @var string 备注
   */
  public $Remarks;
      
  /**
   * @var datetime 建立日期
   */
  public $CreateDate;
      
  /**
   * @var datetime 修改日期
   */
  public $ModifyDate;
  
  /**
   * 
   * @var DiagnosisUserBase 当前病例对用的用户
   */
  public $DiagnosisUserBase;
  
  /**
   * 
   * @var DiagnosisDrugs 当前病例对应的药物
   */
  public $DiagnosisDrugs;
      
  /**
   * @var int 
   */
  public $Status;
      
  public function __construct(){
		$var=get_class_vars(__CLASS__);
    foreach(func_get_args() as $o){
      if(is_array($o)){
        foreach($o as $k => $v){
            if($k=='Id'){
              $this->Id=$v;
              }
            else if($k=='DoctorId'){
                $this->DoctorId=$v;
            }
            else if($k=='PatientId'){
                $this->PatientId=$v;
            }
            else if($k=='Reseaon'){
                $this->Reseaon=$v;
            }
            else if($k=='Property_Ask'){
                $this->Property_Ask=$v;
            }
            else if($k=='Property_Look'){
                $this->Property_Look=$v;
            }
            else if($k=='Property_Listen'){
                $this->Property_Listen=$v;
            }
            else if($k=='Property_Touch'){
                $this->Property_Touch=$v;
            }
            else if($k=='Property_Result'){
                $this->Property_Result=$v;
            }
            else if($k=='Massage'){
                $this->Massage=$v;
            }
            else if($k=='Remarks'){
                $this->Remarks=$v;
            }
            else if($k=='CreateDate'){
                $this->CreateDate=intval($v);
            }
            else if($k=='ModifyDate'){
                $this->ModifyDate=intval($v);
            }
            else if($k=='Status'){
                $this->Status=intval($v);
            }
            else if($k=='DiagnosisUserBase'){
            	$this->DiagnosisUserBase=new DiagnosisUserBase($v);
            }
            else if($k=='DiagnosisDrugs' && is_array($v)){
            	$this->DiagnosisDrugs=array();
            	foreach($v as $i){
            		$this->DiagnosisDrugs=new DiagnosisDrugs($i);
            	}
            }
        }
      }else if(is_object($o)){
        foreach($var as $k => $v){
          if(isset($o->Id)){
            $this->Id=$o->Id;
          }
          if(isset($o->DoctorId)){
            $this->DoctorId=$o->DoctorId;
          }
          if(isset($o->PatientId)){
            $this->PatientId=$o->PatientId;
          }
          if(isset($o->Reseaon)){
            $this->Reseaon=$o->Reseaon;
          }
          if(isset($o->Property_Ask)){
            $this->Property_Ask=$o->Property_Ask;
          }
          if(isset($o->Property_Look)){
            $this->Property_Look=$o->Property_Look;
          }
          if(isset($o->Property_Listen)){
            $this->Property_Listen=$o->Property_Listen;
          }
          if(isset($o->Property_Touch)){
            $this->Property_Touch=$o->Property_Touch;
          }
          if(isset($o->Property_Result)){
            $this->Property_Result=$o->Property_Result;
          }
          if(isset($o->Massage)){
            $this->Massage=$o->Massage;
          }
          if(isset($o->Remarks)){
            $this->Remarks=$o->Remarks;
          }
          if(isset($o->CreateDate)){
            $this->CreateDate=$o->CreateDate;
          }
          if(isset($o->ModifyDate)){
            $this->ModifyDate=$o->ModifyDate;
          }
          if(isset($o->Status)){
            $this->Status=$o->Status;
          }
          if(isset($o->DiagnosisUserBase)){
          	$this->DiagnosisUserBase=new DiagnosisUserBase($o->DiagnosisUserBase);
          }
          if(isset($o->DiagnosisDrugs) && is_array($o->DiagnosisDrugs)){
          	$this->DiagnosisDrugs=array();
          	foreach($o->DiagnosisDrugs as $i){
          	  $this->DiagnosisDrugs[]=new DiagnosisDrugs($i);
          	}
          }
        }
      }
    }
  }

  public function __modetoarray(){
    $var=array();
    foreach(get_class_vars(__CLASS__) as $k => $v){
      if($k=='DiagnosisUserBase'||$k=='DiagnosisDrugs'){
      	continue;
      }
      $var[$k]=$this->$k;
    }
    return $var;
  }
}
?>